package com.insurance.common.enums;

import org.apache.commons.lang.StringUtils;

/**
 * @author Style
 * @version 1.0
 * @date 2021/9/17
 **/
public class MessageEnums {

    public enum MessageTemplateEnum{

        AP01("AP01", "SMS_168586066"),
        AP02("AP02", "SMS_168586066"),
        AP03("AP03", "SMS_168586066"),
        AP04("AP04", "SMS_168586066"),
        TEST("test", "SMS_168586066"),
        AP2021090801("AP2021090801", "SMS_168586066"),
        AP2022080201("AP2022080201", "SMS_168586066");

        private String code;

        private String value;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        MessageTemplateEnum(String code, String value) {
            this.code = code;
            this.value = value;
        }

        public static String getMessage(String code){
            if(!StringUtils.isBlank(code)){
                MessageTemplateEnum[] values = values();
                for(MessageTemplateEnum messageEnum : values){
                    if(messageEnum.getCode().equals(code)){
                        return messageEnum.getValue();
                    }
                }
            }
            return StringUtils.EMPTY;
        }
    }

    public enum MessageSignEnum{

        AP01("AP01", "众保网"),
        AP02("AP02", "易保企服"),
        AP03("AP03", "电动车保险"),
        AP04("AP04", "中盛融安"),
        TEST("test", "中盛融安"),
        AP2022080201("AP2022080201", "众保网"),
        AP2021090801("AP2021090801", "中盛融安");

        private String code;

        private String value;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        MessageSignEnum(String code, String value) {
            this.code = code;
            this.value = value;
        }

        public static String getMessage(String code){
            if(!StringUtils.isBlank(code)){
                MessageSignEnum[] values = values();
                for(MessageSignEnum messageEnum : values){
                    if(messageEnum.getCode().equals(code)){
                        return messageEnum.getValue();
                    }
                }
            }
            return StringUtils.EMPTY;
        }
    }





}
